import request from "@/utils/request-inspection";
import requestGis from "@/utils/request-gis";

class DashboardAPI {
  // ---------------------------------------------------首页 看板-------------------------------------------------
  // 首页报表
  static api_task_count() {
    return request({
      url: "/api/inspection-dashboard/task-count",
      method: "get",
    });
  }

  // 隐患地区分布
  static api_danger(data: any) {
    return request({
      url: "/api/inspection-dashboard/insp-danger-month-count",
      method: "get",
      params: data,
    });
  }

  // 计划/实际巡检分析
  static api_insp(data: any) {
    return request({
      url: "/api/inspection-dashboard/count-by-monthly",
      method: "get",
      params: data,
    });
  }

  // 本月巡检次数
  static api_insp_daily(data: any) {
    return request({
      url: "/api/inspection-dashboard/count-by-daily",
      method: "get",
      params: data,
    });
  }

  // 个人中心(巡检情况)
  static api_user_insp(data: any) {
    return request({
      url: "/api/inspection-dashboard/user-insp-line-length",
      method: "get",
      params: data,
    });
  }

  // ---------------------------------------------------驾驶舱-------------------------------------------------

  // 今日巡线人员
  static api_today_insp_user(data: any) {
    return request({
      url: "/api/inspection-dashboard/today-insp-user",
      method: "get",
      params: data,
    });
  }

  // 今日巡检情况
  static api_today_insp_user_count(data: any) {
    return request({
      url: "/api/inspection-dashboard/today-insp-user-count",
      method: "get",
      params: data,
    });
  }

  // 巡检计划分析
  static api_year_insp_task_count(data: any) {
    return request({
      url: "/api/inspection-dashboard/year-insp-task-count",
      method: "get",
      params: data,
    });
  }

  // 巡检隐患上报
  static api_insp_danger_count(data: any) {
    return request({
      url: "/api/inspection-dashboard/insp-danger-count",
      method: "get",
      params: data,
    });
  }

  // 巡检计划清单
  static api_insp_task(data: any) {
    return request({
      url: "/api/inspection-dashboard/insp-task-dashboard",
      method: "get",
      params: data,
    });
  }

  // 巡检计划清单导出
  static api_export_insp_task(data: any) {
    return request({
      url: "/api/inspection-dashboard/export-insp-task-dashboard",
      method: "get",
      params: data,
      responseType: "blob",
    });
  }

  // 巡检计划分析
  static api_insp_task_analy(data: any) {
    return request({
      url: "/api/inspection-dashboard/insp-task-analy",
      method: "get",
      params: data,
    });
  }

  // 巡检计划分析导出
  static api_export_insp_task_analy(data: any) {
    return request({
      url: "/api/inspection-dashboard/export-insp-task-analy",
      method: "get",
      params: data,
      responseType: "blob",
    });
  }

  // 巡检人员情况分析
  static api_insp_user_analy(data: any) {
    return request({
      url: "/api/inspection-dashboard/insp-user-analy",
      method: "get",
      params: data,
    });
  }

  // 巡检人员情况分析导出
  static api_export_insp_user_analy(data: any) {
    return request({
      url: "/api/inspection-dashboard/export-insp-user-analy",
      method: "get",
      params: data,
      responseType: "blob",
    });
  }

  // 隐患上报清单
  static api_insp_danger(data: any) {
    return request({
      url: "/api/inspection-dashboard/insp-danger-dashboard",
      method: "get",
      params: data,
    });
  }

  // 隐患上报清单导出
  static api_export_insp_danger(data: any) {
    return request({
      url: "/api/inspection-dashboard/export-insp-danger-dashboard",
      method: "get",
      params: data,
      responseType: "blob",
    });
  }

  // 隐患上报分析
  static api_insp_danger_analy(data: any) {
    return request({
      url: "/api/inspection-dashboard/insp-danger-analy",
      method: "get",
      params: data,
    });
  }

  // 隐患上报分析导出
  static api_export_insp_danger_analy(data: any) {
    return request({
      url: "/api/inspection-dashboard/export-insp-danger-analy",
      method: "get",
      params: data,
      responseType: "blob",
    });
  }

  // 隐患分析导出
  static api_export_insp_task_export(data: any) {
    return request({
      url: "/api/insp-task/export",
      method: "get",
      params: data,
      responseType: "blob",
    });
  }

  // GIS

  // 管点资产汇总表
  static api_query_jsongeomasync(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/QueryJsonGeomAsync",
      method: "post",
      data,
    });
  }
  // 管点资产汇总表 导出
  // static api_query_jsongeomasync_export(data: any) {
  //   return requestGis({
  //     url: "/api/GisPointInfo/ExportQueryAsync",
  //     method: "post",
  //     data,
  //     responseType: "blob",
  //   });
  // }

  // 管段资产汇总 导出
  static api_export_line_info_async(data: any) {
    return requestGis({
      url: "/api/GisLineInfo/ExportQueryAsync",
      method: "post",
      data,
      responseType: "blob",
    });
  }

  // 厂站、设备资产清单
  static api_query_by(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/QueryJsonGeomAsync",
      method: "post",
      data,
    });
  }
  // 厂站、设备资产清单 导出
  static api_query_jsongeomasync_export(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/ExportQueryAsync",
      method: "post",
      data,
      responseType: "blob",
    });
  }

  // 管点资产子项 导出
  static api_query_Pointclassid_export(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/ExportByClassIdQueryAsync",
      method: "post",
      data,
      responseType: "blob",
    });
  }
  // 管段资产子项 导出
  static api_query_Lineclassid_export(data: any) {
    return requestGis({
      url: "/api/GisLineInfo/ExportByClassIdQueryAsync",
      method: "post",
      data,
      responseType: "blob",
    });
  }

  // 管网异常上报检测
  static api_query_by_online_monitor_abnormal_async(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/QueryByOnlineMonitorAbnormalAsync",
      method: "post",
      data,
    });
  }
  // 管网异常上报 导出
  static api_export_by_online_monitor_abnormal_async(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/ExportByOnlineMonitorAbnormalAsync",
      method: "post",
      data,
    });
  }

  // ---------------------------------------------------GIS-------------------------------------------------
  // 查询：管点分组统计信息
  static api_query_gis_point_group_info(data: any) {
    return requestGis({
      url: "/api/GisDeviceCategory/QueryGisPointGroupInfoAsync",
      method: "post",
      data: data,
    });
  }
  // 查询：管段分组统计信息
  static api_query_gis_line_group_info(data: any) {
    return requestGis({
      url: "/api/GisDeviceCategory/QueryGisLineGroupInfoAsync",
      method: "post",
      data: data,
    });
  }

  // 设备异常上报
  static api_query_gis_abnormal(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/QueryByOnlineMonitorAbnormalAsync",
      method: "post",
      data: data,
    });
  }

  // 设备异常上报 导出
  static api_export_gis_abnormal(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/ExportByOnlineMonitorAbnormalAsync",
      method: "post",
      data: data,
    });
  }

  // 设备在线监测
  static api_query_gis_monitory(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/QueryByOnlineMonitorAsync",
      method: "post",
      data: data,
    });
  }

  // 设备在线监测 导出
  static api_export_gis_monitory(data: any) {
    return requestGis({
      url: "/api/GisPointInfo/ExportByOnlineMonitorAsync",
      method: "post",
      data: data,
      responseType: "blob",
    });
  }
}
export default DashboardAPI;
